home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr17 / dwcook15.zip / COOKBOOK.DOC next >
Text File  |  1995-03-11  |  22KB  |  435 lines

  1.                          DAVE'S COOKBOOK RECIPE PROGRAM
  2.                                 by Dave Woodall
  3.  
  4.                              ***** IMPORTANT: *****
  5.  
  6.     Always take great care of your cookbook (*.cbk) files.  By this you
  7.   should back them up to a floppy disk often, and keep a copy of the disk
  8.   away from the house - you DON'T want to lose all your favorite recipes
  9.   and have no way to recover them.  The best way is to trade cookbook files
  10.   with family members, so you'll have your recipes in case something bad
  11.   should happen to them.  Always verify that you've entered a new recipe
  12.   correctly, and that it has been saved (to disk) and reloaded without
  13.   error BEFORE you throw away your paper copy.
  14.  
  15.  
  16.   COMMAND LINE SYNTAX:
  17.  
  18.     cookbook                - start the program (and don't load a .cbk file)
  19.     cookbook filename       - load cookbook "filename"
  20.  
  21.            NOTE:  Cookbook files have a special format (outlined
  22.            below)  and use a .cbk extension.  When you specify a
  23.            filename, you may omit  this and the program will add
  24.            it for you.
  25.  
  26.  
  27.   MAIN SCREEN FUNCTIONALITY:
  28.  
  29.     Load Cookbook:
  30.  
  31.     Use this to load a new cookbook into memory.  If there were any recipes
  32.   in memory, they will be cleared out first (if any were changed, you will
  33.   be given the opportunity to save them first).  You may also load a cook-
  34.   book when you start the program by typing "cookbook <filename>".  The
  35.   default extension for a cookbook file is .cbk, and you may omit it.  The
  36.   program will add it for you.
  37.  
  38.     ASCII Import:
  39.  
  40.     Using this function, you may add a new recipe to your cookbook
  41.   (collection of recipes in a file) by grabbing a text file off a disk,
  42.   and inserting it into your cookbook.  It will be inserted before the
  43.   current recipe, or at the very beginning of the cookbook if you haven't
  44.   changed anything.  The format that the recipe must follow is listed at the
  45.   end of this document in Appendix B.
  46.  
  47.     Include Cookbook:
  48.  
  49.     The Include and Extract functions are for trading recipes with others.
  50.   By including a cookbook file, the program will add all the new recipes
  51.   into memory, along with the ones currently there.  They will be placed
  52.   before the current (last edited) recipe.  If there are no recipes in
  53.   memory, this function acts just like a Load, except no filename is saved.
  54.   Basically, this is the same as an "Import" but imports my special binary
  55.   format (shown below) instead of an ASCII file).
  56.  
  57.     Extract Cookbook:
  58.  
  59.     The Extract function allows you to choose a few recipes, and create a
  60.   new cookbook file with them.  You may select a group with the Search Recipe
  61.   function, or you may select a new group in this screen.  Once you say "Ok",
  62.   the file will be written.  You may at this point select to write the file
  63.   in plain ASCII instead of the binary .cbk format.
  64.  
  65.     Save Cookbook:
  66.  
  67.     Obvious.  If the file doesn't exist, it is written automatically.  If it
  68.   does, then you are given four options:  1) Overwrite - the old version of
  69.   the file is deleted and the new replaces it, 2) Backup - the old version is
  70.   renamed with a .bak extension, and the new file is written.  If there
  71.   already is a .bak, it is first deleted.  3) Create new - you are given the
  72.   opportunity to give a new filename.  4) Abort - don't save any changes.
  73.  
  74.     Edit A Recipe:
  75.  
  76.     This button takes you immediately to the Recipe Edit Screen, where you
  77.   can edit, print, export, scale (etc.) the *current* recipe.
  78.  
  79.     This screen was designed to allow you to enter your recipes very quickly.
  80.   Use the mouse to click on the field you want to enter, and go at it.  You
  81.   may also use Tab and Shift-Tab to go forward and back.  To advance out of
  82.   the Ingredients area, you MUST use the mouse.  To enter a Fraction and the
  83.   Type for an ingredient, select one of the boxes on the top of the screen.
  84.   For an ingredient to be considered valid (and retained) you MUST enter an
  85.   Item name for each.  If you omit the Type, "whole" will be used.  If you
  86.   omit an amount (whole and fraction) a "1" will be used.
  87.  
  88.     Other editing features:  First off, hit F1 to flip to the Help screen.
  89.   This screen tells you all of the keyboard and mouse functions.  Since the
  90.   keyboard's insert, delete and backspace keys are already used for inserting
  91.   and deleting characters, a few function keys are used for special editing.
  92.   These keys are:
  93.  
  94.     Esc - abort all edits on current recipe - return to the previous menu.
  95.     F2  - clear current field.
  96.     F3  - delete current Ingredient or Instruction text line.
  97.     F4  - insert new Ingredient or Instruction text line.
  98.  
  99.     What do you do with the Descriptor field?  Use this for entering a
  100.   "condition" for the Item.  So, if the recipe calls for "warmed milk"
  101.   or "sliced beef", put "warmed" or "sliced" in the Descriptor field.  Why?
  102.   When you produce a Shopping List, the program will merge all the ingred-
  103.   ients from all the recipes you choose.  What you want to know is how much
  104.   you need to buy.  So for example, you don't want to see "1 chopped onion"
  105.   and "1 diced onion", you want to see 2 onions.
  106.  
  107.     What about the Keyword field?  You may well leave this blank if you
  108.   wish (it won't make any difference to the file size though).  This is
  109.   to aid in searching through your recipes.  If you mark all your pie recipes
  110.   with a "pie" keyword, you may later search for all recipes with a "pie"
  111.   keyword.  This is a free-format line - enter as much as you want, in any
  112.   case.
  113.  
  114.     If you want to print a recipe, just click on Print.  If you want to make
  115.   a quadruple batch of something, first hit Scale, and enter a 4.  Then hit
  116.   Print.  Compare the print out to the original recipe!!!  You may Scale your
  117.   recipes from 0.01 to 100.0 of their original size.  NOTE:  Some people say
  118.   that expanding or shrinking a recipe more than a factor of four (4.0) alters
  119.   the recipe, even though the correct proportions are maintained.  So, just
  120.   keep this in mind when cooking for 100 (yeah, right).
  121.  
  122.     If you want to Export this recipe to an ASCII file, click on Export.
  123.   You will be prompted for a filename, then the recipe is written to it.
  124.   To export a group of recipes, use the Search and Extract functions.
  125.  
  126.     Use Next and Previous to move through the recipes, Insert to add a
  127.   recipe in front of the current recipe, and Delete to remove the currently
  128.   displayed recipe.  Undo will get rid of ALL changes you have made to this
  129.   recipe since it has been displayed.  Note that whenever you leave the
  130.   current recipe, changes are saved (in memory only).  Use Done to exit back
  131.   to the previous menu.
  132.  
  133.     TIP:  If your cookbook becomes large, use the Search function to quickly
  134.   locate a desired recipe.  Or, go into "Make Shopping List", and highlight
  135.   the recipe.  Escape out to the Main Menu and select Edit.  Your current
  136.   recipe is selected!
  137.  
  138.     NOTE:  Some recipes put a few (or all) of the ingredients in the
  139.   instructions area.  You may do this if you wish, BUT by doing this, you
  140.   give up the ability to make Shopping Lists, and to Scale your recipes.
  141.   It is usually better to change the instructions to refer to the ingredients
  142.   that you place above.
  143.  
  144.     What Can I Make?:
  145.  
  146.     This feature allows you to input a list of ingredients, then will search
  147.   the cookbook for recipes that you can make with this list of ingredients.
  148.   The list of recipes that is returned will include those that contain other
  149.   ingredients as well as the ones you list.  Like the Search function below,
  150.   you may click on a recipe in the list and jump into the Recipe Edit Screen.
  151.  
  152.     Note:  The ingredient names you enter on this screen are treated as
  153.   search "sub-strings".  That means that if you type "butter" on one of the
  154.   lines, it will match not only butter, but "peanut butter" and "buttermilk".
  155.   This is to be expected (it's *not* a bug!) and allows more recipes to
  156.   match.  It also allows "egg" to match "eggs" and other compares you wouldn't
  157.   like thrown out.
  158.  
  159.     Sort Recipes:
  160.  
  161.     The sort function allows you to reorder your recipes by one of the
  162.   following orders:  1) Author, 2) Title, or 3) Keywords.  When sorting by
  163.   keywords, the program will sort them as one string (instead of a series
  164.   of keywords).  For this reason, it is handy to make the first keyword
  165.   you list to be the most important.
  166.  
  167.     If you want to sort primarily on Author, but have everything within
  168.   the Author sorted by Title, do two sorts - first by Title, then by
  169.   Author.
  170.  
  171.     Search Recipes:
  172.  
  173.     With the search function, you can say, "let me see all the recipes that
  174.   have cinnamon in them.".  Or, "let me see all the recipes written by mom",
  175.   or "let me see all the cake recipes".  Here's how to do it:  When the
  176.   screen comes up, enter a search string like "cinnamon" or "mom" or "cake".
  177.   Then use the mouse to choose which parts of the recipes you want to
  178.   search through.  Some don't make sense - like searching for "mom" in the
  179.   ingredients.  The search is not case sensitive, so type what you like.  Be
  180.   careful when specifying search strings, because you may miss recipes.  For
  181.   example, a search string of "banana" will match "banana" and "bananas", but
  182.   "bananas" won't match "banana" (smaller search strings are able to match
  183.   more recipes).
  184.  
  185.     Once you've got a list of matches, you can do a few things.  You can
  186.   just quit back to the Main Menu (Done), you can kick off a New Search, or
  187.   (the really cool one) use the mouse to slide the list and click to select one
  188.   of the matches and flip over to the Edit Screen so you can Edit, Print or
  189.   Export it.  You can even go into the Shopping List, and your selection
  190.   is retained!
  191.  
  192.     Shopping List:
  193.  
  194.     This is an interesting function.  Here, you select a number of recipes
  195.   that you want to make (and for each you can specify a scaling factor).
  196.   After you finish choosing recipes, the program will go off and create a
  197.   single list of ingredients, sum all that are alike, and print a list of
  198.   required ingredients that you need to have to make the recipes you've
  199.   selected.  You may also have the program print out the individual
  200.   recipes as well!
  201.  
  202.     Configuration:
  203.  
  204.     a) Colors:
  205.  
  206.        To change the color of an item, you click on two items:  1) First,
  207.        click on the name of the item you want to change, then 2) click on
  208.        the color in the palette that you want that item to become.  The
  209.        name of the item should become the color you have chosen.  The
  210.        program also gives you complete control over setup of the palette
  211.        as well, so read the next paragraph before spending too much time
  212.        modifying your colors!
  213.  
  214.     b) Palette:
  215.  
  216.        Unlike most programs, this one will let you change the "palette"
  217.        or table of colors that you may choose from in your color selections.
  218.        Interestingly, when you change the color of a palette entry, *all*
  219.        items using that color will immediately change to the new color!
  220.  
  221.        To change a palette entry, just click on the one you want to change.
  222.        A small menu will appear at the bottom of the screen.  R G B stands
  223.        for Red, Green, and Blue, "i" stands for "intensity" and "b" stands
  224.        for "base".  Below this line, is a string of "1"s and "0"s.  A "1"
  225.        means that that portion of the color is included, and "0" means it
  226.        is not included.  The "1" and "0" line will change to the current
  227.        settings as you modify them.
  228.  
  229.        Clicking on a "base" portion adds a large amount of color, and clicking
  230.        on an "intensity" portion adds just a little.  You can click on these
  231.        six settings as long as you like, then click on "Done" when finished.
  232.        If you experiment, you can find up to 8 shades of each color - although
  233.        it is not too practical for normal uses (a wider variety of colors is
  234.        usually more helpful).
  235.  
  236.        TIPS:
  237.  
  238.          1) Setup your palette *before* you select colors for certain
  239.             screen items.
  240.  
  241.          2) Palette entry zero is the background of the screen.
  242.  
  243.          3) Use palette entries 1-7 for screen items labeled "background".
  244.             Due to a quirk in DOS, if you use 8-15 for a background color,
  245.             and you choose a high intensity color, it will *not* appear
  246.             high intensity, and foreground colors used on top of it may
  247.             not show up correctly.  You may use entries 1-7 for foreground
  248.             colors if you don't need all seven for backgrounds.  There will
  249.             be no color conflicts in this case.  Also, just because you
  250.             select a color for use in a background doesn't mean you can't
  251.             use it somewhere else in a foreground.  Remember, you've got
  252.             15 colors to select, and 40 screen items that use them.
  253.  
  254.          4) Don't set the pair of background and foreground colors (for the
  255.             same screen item) to the same or very close colors.  This will
  256.             render the text *very* difficult to read.  The best arrangement
  257.             is to make one light and another dark.  But even that can be
  258.             taken too far - sometimes black on white or white on black can
  259.             be very hard on the eyes!  (too much contrast)
  260.  
  261.     c) Scrolling Delay:
  262.  
  263.        Several of the Cookbook's functions use a scrolling window. Due to
  264.        the vast variety of machine configurations (and personal taste
  265.        differences), I added a delay setting.  This setting is in milli-
  266.        seconds, and may be set anywhere from 1 to 2000 (2 seconds).  To
  267.        set this to your liking, enter a value, hit the right mouse button
  268.        (exit the Configuration window) and go into Extract Cookbook.  If
  269.        the list goes too fast, go back and increase this value.  If too
  270.        slow, decrease it.  This same value controls the scroll rate of all
  271.        scrolling windows.
  272.  
  273.     d) Printer:
  274.  
  275.        Click on the Printer keyword to change the printer setting.  You may
  276.        put any text here (up to 15 characters), and the string will not be
  277.        checked.  Normally, you will only use "LPT1" or "LPT2".  You may also
  278.        put a file name here, and the program will write any text to the file
  279.        instead of the printer.  Be careful not to enter a string that contains
  280.        illegal filename characters (like spaces), because the resulting name
  281.        of the file will not be deletable by normal DOS commands.
  282.  
  283.     e) Defaults:
  284.  
  285.        If you get your setups really confused, click on "Defaults" to reset
  286.        them to the pre-stored internal defaults.  These are the settings in
  287.        effect when you first start up the program.  Or, if you have a good
  288.        setup in COOKBOOT.DAT, and you want to abort the settings you've
  289.        just changed (and you haven't saved to COOKBOOK.DAT), just exit the
  290.        program and restart.  If you're *really* hosed, exit to DOS, delete
  291.        the file COOKBOOK.DAT, and rerun the Cookbook.
  292.  
  293.     f) Save File:
  294.  
  295.        By making changes to your configuration, you are just changing what
  296.        is in memory at the current time.  If you want to save these settings,
  297.        click on "Save File" and your current configuration will be saved to
  298.        "COOKBOOK.DAT" in the same directory as COOKBOOK.EXE.  The next time
  299.        you start up the program, these values will be loaded automatically,
  300.        thus saving you setup time in future uses.
  301.  
  302. APPENDIX A:  NOTES ON MEMORY USAGE:
  303.  
  304.     This program will allocate memory as recipes are created and/or loaded.
  305.   During normal editing, memory can be lost as recipes are deleted or change
  306.   size.  To avoid this, a simple memory management scheme is used:  If a
  307.   recipe is edited, and the new size is the same size or smaller, then it
  308.   is placed in the same memory as before.  If it has grown, then new memory
  309.   is allocated for it and the old is temporarily lost.  After 15 of these
  310.   allocations have occured (I don't know, 15 seems like a good number), the
  311.   cookbook is written to a scratch file (xxxxcook.tmp), the entire heap is
  312.   released, then the cookbook is read back in fresh.  This will ensure that
  313.   memory usage is maximized.  However, this also means that you need to have
  314.   at least as much free disk space available as the size of your cookbook!
  315.  
  316.     What makes a recipe take more memory?  Two parts of each recipe are
  317.   variable, as you will see if you examine the .cbk file in Appendix C.
  318.   The two parts are 1) the ingredients (about 60 bytes for each) and 2) the
  319.   instructions area (1 byte per character).  Recipes average about 820 bytes.
  320.  
  321.  
  322. APPENDIX B:  ASCII FILE FORMAT:
  323.  
  324.     The ASCII File format that is Imported and Exported is detailed here.
  325.   Please note that it is "keyword" driven, which means that the keywords may
  326.   appear in any order.  The only restriction is the "Title" keyword.  "Title"
  327.   MUST appear as the first keyword in each recipe.  This is so that you may
  328.   put several ASCII recipes into one file and Import them all at once.
  329.  
  330.     Keywords:  (may appear in any order - include the colon!)
  331.  
  332.       Title:         (must be first!!!)
  333.       Author:
  334.       Ingredients:
  335.       Keywords:      (optional - left blank if omitted)
  336.       Instructions:
  337.  
  338.   Other Notes:
  339.  
  340.   1) Blank lines are ignored - use as many as you like.
  341.  
  342.   2) Leading and trailing spaces are also ignored.  You can line up items
  343.      into columns, or just leave a space or two.  DON'T USE TAB CHARACTERS!
  344.  
  345.   3) Ingredient lines must appear in the following order:
  346.  
  347.          integer  [fraction]  type  ingredient  [(description)]
  348.  
  349.      where:
  350.  
  351.        integer          - the whole number part of the quantity
  352.        [fraction]       - the optional fraction - must be of type shown below:
  353.                             1/16  1/8  1/6  1/4  1/3  1/2  2/3  3/4  5/6  7/8
  354.                           (place *no* spaces in the fraction!)
  355.        type             - measurement type - defaults to "whole" if illegal
  356.                             teas.  tbsp.  oz(vol)  cups  pints  quarts  gallons
  357.                             oz(wgt)  pounds  cans  jars  boxes  other   whole
  358.        ingredient       - ASCII text ingredient name
  359.        [(description)]  - optional description - must be in parentheses
  360.  
  361.      Example ASCII file (1 recipe)
  362.  
  363. Title:  Brownies
  364. Author: Grandma Woodall
  365. Keywords: brownies cake dessert cookies
  366.  
  367. Ingredients:
  368.   2      whole   unsweetened chocolate  (squares)
  369.   1      cups    canola oil
  370.   2      cups    sugar
  371.   3      whole   eggs  (large)
  372.   1 1/2  cups    flour
  373.   1      teas.   baking powder
  374.   1      teas.   salt
  375.   1      cups    broken nuts  (optional)
  376.  
  377. Instructions:
  378. Melt chocolate in oil (microwave), and add the rest in the order shown 
  379. making sure that the eggs don't cook in the warmed oil/chocolate.  Before
  380. adding the flour, mix the salt and baking powder into the flour - then
  381. mix the flour mixture into the batter.  Pour the completed mixture into
  382. a greased and floured 9" x 13" cake pan.  Bake at 350 F for 30 minutes.
  383.  
  384. (Note: If another recipe is to follow, it should start with the "Title:"
  385.        keyword.)
  386.  
  387.  
  388.  
  389. APPENDIX C:  COOKBOOK FILE (.CBK) FORMAT:
  390.  
  391.         #bytes:  description:
  392.         -------  -----------------------------------------------
  393.              8   ASCII signature 'cookbook'       --+
  394.              2   num of remaining bytes in file hdr |
  395.              1   file major version (currently 1)   |-- file header
  396.              1   file minor version (currently 0)   |
  397.              2   number of recipes in cookbook (R): |
  398.              2   spare                            --+
  399.  
  400.              2   num of remaining bytes in recipe    -----------+
  401.             30   title of recipe in ASCII (null term)           |
  402.             26   author of recipe in ASCII (null term)          |
  403.             46   recipe keywords in ASCII (null term)           |
  404.              1   flag 1 (unused in file)                        |
  405.              1   flag 2 (unused in file)                        |
  406.              2   number of ingredients (N):                     | repeat
  407.                                                                 | for R
  408.              3   whole num portion in ASCII          --+        | recipes
  409.              1   null terminator                       | repeat |
  410.              2   coded value for fractional portion    | for N  |
  411.              2   coded value for measurement type      | ingrd. |
  412.             26   descriptor in ASCII (null term)       |        |
  413.             26   ingrd. name in ASCII (null term)    --+        |
  414.                                                                 |
  415.              2   num of total instruction ASCII chars (M)       |
  416.              M   instruction bytes:                             |
  417.                    a) each line is NULL terminated   -----------+
  418.  
  419.      Coded values for fractions:      Coded values for measurement types:
  420.  
  421.        sixteenth     = 1                teaspoon   = 1     {volumes in tsps.}
  422.        eighth        = 2                tablespoon = 3
  423.        sixth         = 3                oz_v       = 6
  424.        fourth        = 4                cup        = 48
  425.        third         = 5                pint       = 96
  426.        half          = 6                quart      = 192
  427.        two_thirds    = 7                gallon     = 768
  428.        three_fourths = 8                oz_w       = 16    {weights in drams}
  429.        five_sixths   = 9                pound      = 256
  430.        seven_eighths = 10               can        = -1    {"other" codes}
  431.                                         jar        = -2
  432.                                         boxes      = -3
  433.                                         other      = -4
  434.                                         whole      = -5
  435.